package com.stx.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import java.time.LocalDateTime;
@Data
@TableName("r_player")
@EqualsAndHashCode
public class Player {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @NotEmpty(message = "选手姓名不能为空")
    private String plaName;
    @NotEmpty(message = "性别不能为空")
    private String plaGender;
    @NotEmpty(message = "部门不能够为空")
    private String plaDepartment;
    private Integer plaState;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime plaDate;
    private String plaAvatar;
    private String plaPhoto;
    @TableField(exist = false)
    private Double avgScore;
    @TableField(exist = false)
    private Integer rank;
    @TableField(exist = false)
    private Integer ruaNumber;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public @NotEmpty(message = "选手姓名不能为空") String getPlaName() {
        return plaName;
    }

    public void setPlaName(@NotEmpty(message = "选手姓名不能为空") String plaName) {
        this.plaName = plaName;
    }

    public @NotEmpty(message = "性别不能为空") String getPlaGender() {
        return plaGender;
    }

    public void setPlaGender(@NotEmpty(message = "性别不能为空") String plaGender) {
        this.plaGender = plaGender;
    }

    public @NotEmpty(message = "部门不能够为空") String getPlaDepartment() {
        return plaDepartment;
    }

    public void setPlaDepartment(@NotEmpty(message = "部门不能够为空") String plaDepartment) {
        this.plaDepartment = plaDepartment;
    }

    public Integer getPlaState() {
        return plaState;
    }

    public void setPlaState(Integer plaState) {
        this.plaState = plaState;
    }

    public LocalDateTime getPlaDate() {
        return plaDate;
    }

    public void setPlaDate(LocalDateTime plaDate) {
        this.plaDate = plaDate;
    }

    public String getPlaAvatar() {
        return plaAvatar;
    }

    public void setPlaAvatar(String plaAvatar) {
        this.plaAvatar = plaAvatar;
    }

    public String getPlaPhoto() {
        return plaPhoto;
    }

    public void setPlaPhoto(String plaPhoto) {
        this.plaPhoto = plaPhoto;
    }

    public Double getAvgScore() {
        return avgScore;
    }

    public void setAvgScore(Double avgScore) {
        this.avgScore = avgScore;
    }

    public Integer getRank() {
        return rank;
    }

    public void setRank(Integer rank) {
        this.rank = rank;
    }

    public Integer getRuaNumber() {
        return ruaNumber;
    }

    public void setRuaNumber(Integer ruaNumber) {
        this.ruaNumber = ruaNumber;
    }

    @Override
    public String toString() {
        return "Player{" +
                "id=" + id +
                ", plaName='" + plaName + '\'' +
                ", plaGender='" + plaGender + '\'' +
                ", plaDepartment='" + plaDepartment + '\'' +
                ", plaState=" + plaState +
                ", plaDate=" + plaDate +
                ", plaAvatar='" + plaAvatar + '\'' +
                ", plaPhoto='" + plaPhoto + '\'' +
                ", avgScore=" + avgScore +
                ", rank=" + rank +
                ", ruaNumber=" + ruaNumber +
                '}';
    }
}
